﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace Ozone.Views.Widget
{
    /// <summary>
    /// UC2ValveImg.xaml 的交互逻辑
    /// </summary>

    public partial class UC2ValveImg : UserControl
    {
        int nCurStatus = 0;
        List<Image> lstImg = new List<Image>();

        public UC2ValveImg()
        {
            InitializeComponent();
            lstImg.Add(img1);
            lstImg.Add(img2);
        }

        //保护阀开
        public void setStatus(int nStatus)
        {

            if (nCurStatus == nStatus)
                return;

            nCurStatus = nStatus;

            for (int i=0;i< lstImg.Count;i++)
            {
                if(nStatus == i)
                {
                    lstImg[i].Visibility = Visibility.Visible;
                }
                else
                {
                    lstImg[i].Visibility = Visibility.Collapsed;
                }
            }
           
        }

       
    }
}
